<template>
  <div class="app-container book">
    <div class="content">
      <div class="block" v-for="(item,index) in list" :key="index" @click="goToInfo(item)">
        <div class="item">
          <img class="item-cover" :src="ImgSrc + item.cover+'.jpg'" alt="">
          <div class="item-right">
            <span class="name">{{item.externalSourceName}}</span>
            <span class="author">{{item.externalSourcePeriods}}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import baseUrl from "@/api/base";
export default {
  props:["list"],
  data() {
    return {
      currentPage: 1
    };
  },
  components: {},
  created(){
     this.ImgSrc = baseUrl.periodicalUrl;
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    goToInfo(item) {
      this.$router.push("/periodical/info?max_file_name="+item.cover+"&resourceType=5&value="+item.source);
    },
  }
};
</script>
<style lang="less" scoped>
.book {
  padding: 0px 20px 20px 20px;
  border-radius: 10px;
  background: #fff;
  .content {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 30px;
    .block {
      width: 260px;
      margin-top: 20px;
      padding-bottom: 24px;
      border-bottom: 1px solid #eaeaea;
      margin-bottom:-1px;
      cursor: pointer;
      .item {
        display: flex;
        .item-cover {
          width: 120px;
          height: 160px;
        }
        .item-right {
          flex: 1;
          display: flex;
          flex-direction: column;
          margin-left: 20px;
          .name {
            font-size: 18px;
            margin-top: 12px;
          }
          .author {
            font-size: 14px;
            color: #a1a1a1;
            margin-top: 18px;
          }
          .desc {
            font-size: 14px;
            color: #868686;
            margin-top: 14px;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            overflow: hidden;
          }
          .time {
            font-size: 12px;
            color: #c1c1c1;
            margin-top: 20px;
          }
        }
      }
    }
    .block:not(:nth-child(4n +1)) {
      padding-left: 40px;
    }
  }
}
</style>


